package com.liruo.learn.spring.mvc.controller.err;

import com.liruo.learn.spring.mvc.config.mvc.ExceptionConfig;
import com.liruo.learn.spring.mvc.err.BaseResp;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author:liruo
 * @Date:2023-02-13-23:24:29
 * @Desc
 */
@Controller
@RequestMapping("/exception")
public class ExceptionHandlerController {
    @GetMapping("/notfound")
    public void err(){
        throw new ExceptionConfig.ResourceNotFoundException("sb");
    }
    @GetMapping("/GlobalErrHandlerTest")
    public BaseResp<String> withCode(){
        throw new RuntimeException("withCode");
    }
}
